#include <windows.h>
#include <PELib.h>
#include <stdio.h>
int main(int argc,char** argv)
{
	
	char* out = NULL;
	if (argc < 3)
	{
		printf("COMMAND ERROR\n;cmd processid module [out]\n");
		return 0;
	}
	if (argc > 3)
		out = argv[3];
	DWORD pid;
	if (sscanf(argv[1], "%d", &pid) < 1)
	{
		printf("Invalid ProcessId\n");
		return 0;
	}
	if (dumpPe(pid, argv[2], out))
		printf("DUMP SUCCESS\n");
	else
		printf("DUMP FALSE\n");
	return 0;

}